
import Vue from "vue";
import VueRouter from "vue-router";
// 登录页面引入
import Login from "../views/login/Login.vue";
// 首页页面引入
import Home from "../views/home/Home.vue";
// 新增用户页面引入
import usersAdd from "../views/home/UsersAdd.vue";
// 用户列表页面引入
import usersList from "../views/home/UsersList.vue";
// 会员充值页面引入
import Vip from "../views/vip/Vip.vue";
// 会员列表页面引入
import VipList from "../views/vip/VipList.vue";
// 套餐管理列表引入
import MealList from "../views/meal/MealList.vue";
// 套餐新增页面引入
import MealAdd from "../views/meal/MealAdd.vue";
import CarouselList from '../views/carousel/CarouselList.vue'
import DishesList from '../views/dishes/DishesList.vue'
//轮播图页面引入
import CarouselAdd from '../views/carousel/CarouselAdd.vue'
import MealUpData from "../views/meal/MealUpData.vue"
Vue.use(VueRouter);

const routes = [
  // 默认路由
  {
    path: "/",
    component: Login,
  },
  {
    path: "/login",
    name: "Login",
    component: Login,
  },
  {
    path: "/home",
    name: "home",
    component: Home,
    children: [
      // 管理员管理
      {
        path: "usersAdd",
        name: "usersAdd",
        component: usersAdd,
        meta: {
          title: "管理员管理",
          text: "添加管理员",
        },
      },
      {
        path: "usersList",
        name: "usersList",
        component: usersList,
        meta: {
          title: "管理员管理",
          text: "管理员列表",
        },
      },
      // 会员管理
      {
        path: "vip",
        name: "Vip",
        component: Vip,
        meta: {
          title: "会员管理",
          text: "后端充值会员",
        },
      },
      {
        path: "vipList",
        name: "VipList",
        component: VipList,
        meta: {
          title: "会员管理",
          text: "会员列表",
        },
      },
      // 套餐管理
      {
        path: "mealList",
        name: "MealList",
        component: MealList,
        meta: {
          title: "套餐管理",
          text: "套餐列表",
        },
      },
      {
        path: "mealAdd",
        name: "MealAdd",
        component: MealAdd,
        meta: {
          title: "套餐管理",
          text: "新增套餐",
        },

      },
        {
                path: "mealUpData/:_id",
                name: "MealUpData",
                component: MealUpData,
                meta: {
                    title: "套餐管理",
                    text: "修改套餐",
                },
            },
      {
        path: "CarouselAdd",
        name: "CarouselAdd",
        component: CarouselAdd,
        meta: {
          title: "轮播图管理",
          text: "添加轮播图"
        }
      },
      {
        path: "CarouselList",
        name: "CarouselList",
        component: CarouselList,
        meta: {
          title: "轮播图管理",
          text: "轮播图列表"
        }
      },
      {
        path: "DishesList",
        name: "DishesList",
        component: DishesList,
        meta: {
          title: "菜谱管理",
          text: "菜单列表"
        }
      }
    ],
  },
]



const router = new VueRouter({
  routes,
  mode: "history",
});

export default router;